//
//  ShipperAuthVC.m
//  NtoccShipper
//
//  Created by mac on 2019/11/8.
//  Copyright © 2019 zhuchongjin. All rights reserved.
//

#import "ShipperAuthVC.h"
#import "UpLoadImaeVC.h"
#import "ShipmentModel.h"
#import "FieldRequiredSetModel.h"
#import "XLImageViewer.h"
#import "ZHFAddTitleAddressView.h"
#import "StrongReminderView.h"
@interface ShipperAuthVC ()<UITableViewDelegate,UITableViewDataSource ,ZHFAddTitleAddressViewDelegate>
@property (nonatomic,strong) CJTableView *tableView;
// 头部图片
@property (nonatomic,strong) UIImageView *imgVShipperTop;
@property (nonatomic,strong) UIImageView *imgVShipperheader;
@property (nonatomic,strong) CJLabel *labTitle;
@property (nonatomic,strong) CJLabel *labTitleContent;

//身份证人像面照片
@property (nonatomic,strong) CJLabel *labUpLoadIDFront;
@property (nonatomic,strong) CJLabel *labUpLoadIDFrontChange;
@property (nonatomic,copy) NSString *strUpLoadIDFront;
@property (nonatomic,strong) FlexTouchView *touchIDFrontRequired;
//身份证国徽面照片
@property (nonatomic,strong) CJLabel *labIDReverse;
@property (nonatomic,strong) CJLabel *labIDReverseChange;
@property (nonatomic,copy) NSString *strIDReverse;
@property (nonatomic,strong) FlexTouchView *touchIDReverseRequired;
//手持
@property (nonatomic,strong) CJLabel *labIDInhandIm;
@property (nonatomic,strong) CJLabel *labIDInhandImChange;
@property (nonatomic,copy) NSString *strIDInhandIm;
@property (nonatomic,strong) FlexTouchView *touchIDInhandImRequired;
//企业营业执照
@property (nonatomic,strong) CJLabel *labBusinessLicenseImg;
@property (nonatomic,strong) CJLabel *labBusinessLicenseImgChange;
@property (nonatomic,copy) NSString *strBusinessLicenseImg;
@property (nonatomic,strong) FlexTouchView *viewBusinessLicenseImgRequired;
//托运人姓名
@property (nonatomic,strong) CJTextField *fieldName;
@property (nonatomic,strong) CJView *viewNameRequired;
// 联系方式
@property (nonatomic,strong) CJTextField *fieldShipperName;
//公司名称
@property (nonatomic,strong) CJTextField *fieldCompanyName;
@property (nonatomic,strong) CJView *viewCompanyNameRequired;
// 法人代表名称
@property (nonatomic,strong) CJTextField *fieldLegalName;
@property (nonatomic,strong) CJView *viewLegalNameRequired;
//身份证号
@property (nonatomic,strong) CJTextField *fieldIdNum;
@property (nonatomic,strong) CJView *viewIdNumRequired;
//  idCardDueDate  身份证有效期
@property (nonatomic,strong) CJTextField *fieldIdCardDueDate;
@property (nonatomic,strong) CJView *viewIdCardDueDateRequired; //是否必填
@property (nonatomic,strong) UILabel *labIdCardDueDate;
//身份证 长期相关
@property (nonatomic,strong) FlexTouchView *touchIdCardDueDate; //
@property (nonatomic,copy) NSString *strIdCardDueDateLong; // 长期1  默认0 非长期
@property (nonatomic,strong) CJImageView *imgVIDLong;
// 信用代码
@property (nonatomic,strong) CJTextField *fieldBusinessLicenseImgNumber;
@property (nonatomic,strong) CJView *viewBusinessLicenseRequired;
// 所属主管税务机关
@property (nonatomic ,strong) CJView *viewTax;
@property (nonatomic,strong) CJTextField *fieldTaxAuthority;
//@property (nonatomic,strong) UILabel *labTaxRequired;
//通信地址
@property(nonatomic,strong)ZHFAddTitleAddressView * addTitleAddressView;
@property (nonatomic,strong) CJTextField *fieldAdress;
@property (nonatomic,copy) NSString *strAddressCode;
@property (nonatomic,strong) CJView *viewAdressRequired;
//详细地址
@property (nonatomic,strong) CJTextField *fieldAdressDetail;
@property (nonatomic,strong) CJView *viewAdressDetailRequired;
//货主简称码
@property (nonatomic,strong) CJTextField *fieldPrefix;
@property (nonatomic,strong) CJView *viewPrefixRequired;

@property (nonatomic,strong) ShipmentModel *model;
@property (nonatomic,strong) UIView *viewSave;
@property (nonatomic,strong) FieldRequiredSetModel *fieldReqModel;

@property (nonatomic, strong) CJLabel *fuwufeiLabel;
@property (nonatomic, strong) CJLabel *upLoadNumberLabel;
@property (nonatomic, strong) CJLabel *yichangFeiLabel;


@end

@implementation ShipperAuthVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self setTitleName:CJLString(@"认证信息")];
    [self setBackLeftButton:@""];

    [self.view addSubview:self.tableView];
    self.addTitleAddressView = [[ZHFAddTitleAddressView alloc]init];
    [self setUI];
    [self createTableView];
    [self laodData];
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self getFieldRequiredSetting];
    [self setFieldLimit];
    
//    if ([CJControl getIdCardDueWarn] && [CJControl getStrongReminderShow]) {
//        [[[StrongReminderView shared]initWithView] hidden];
//    }
}


- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
//    if ([CJControl getIdCardDueWarn] && [CJControl getStrongReminderShow]) {
//        [[[StrongReminderView shared]initWithView] show];
//    }
}
- (void)getFieldRequiredSetting{
    
    WS(ws);
    [CJNetWork getFieldRequiredSetting:[CJControl getIsCompany] ? @"shipmentCompany":@"shipment" InfoSuccess:^(id  _Nullable responseObject) {
        DLog(@"===== %@",responseObject);
        NSError *error;
        ws.fieldReqModel = [[FieldRequiredSetModel alloc]initWithDictionary:responseObject error:&error];
        [ws setFieldRequiredShowOrHide];
    }];
}

/// <#Description#>
- (void)setFieldRequiredShowOrHide{
    

//    身份证正面
    if (self.fieldReqModel.identificationImg == 1) {
        self.touchIDFrontRequired.hidden = NO;
    }else{
        self.touchIDFrontRequired.hidden = YES;
    }
//    反面
    if (self.fieldReqModel.identificationBackImg == 1) {
        self.touchIDReverseRequired.hidden = NO;
    }else{
        self.touchIDReverseRequired.hidden = YES;
    }

//    手持
    if (self.fieldReqModel.identificationInhandImg == 1) {
        self.touchIDInhandImRequired.hidden = NO;
    }else{
        self.touchIDInhandImRequired.hidden = YES;
    }
   
//    企业营业执照
    if (self.fieldReqModel.businessLicenseImg == 1) {
        self.viewBusinessLicenseImgRequired.hidden = NO;
    }else{
        self.viewBusinessLicenseImgRequired.hidden = YES;
    }
    
//    托运人姓名
    if (self.fieldReqModel.userName == 1) {
        self.viewNameRequired.hidden = NO;
    }else{
        self.viewNameRequired.hidden = YES;
    }
    
//    公司名称
    if (self.fieldReqModel.companyName == 1) {
        self.viewCompanyNameRequired.hidden = NO;
    }else{
        self.viewCompanyNameRequired.hidden = YES;
    }
    
//    法人代表名称
    if (self.fieldReqModel.legalName == 1) {
        self.viewLegalNameRequired.hidden = NO;
    }else{
        self.viewLegalNameRequired.hidden = YES;
    }
//    IDNUM
    if (self.fieldReqModel.identificationNumber == 1) {
        self.viewIdNumRequired.hidden = NO;
    }else{
        self.viewIdNumRequired.hidden = YES;
    }
    
//  idCardDueDate  身份证有效期
    if (self.fieldReqModel.idCardDueDate == 1) {
        self.viewIdCardDueDateRequired.hidden = NO;
    }else{
        self.viewIdCardDueDateRequired.hidden = YES;
    }
    
//    判断是否展示证件过期预警
    if ([CJControl getIdCardDueWarn]) {
        self.labIdCardDueDate.hidden = NO;
        self.fieldIdCardDueDate.textColor = UIColor.redColor;
    }else{
        self.labIdCardDueDate.hidden = YES;
        self.fieldIdCardDueDate.textColor = [UIColor cjMainTextColor];
    }

    
//    信用代码
    if (self.fieldReqModel.businessLicenseImgNumber == 1) {
        self.viewBusinessLicenseRequired.hidden = NO;
    }else{
        self.viewBusinessLicenseRequired.hidden = YES;
    }
    
//    所属主管税务机关
    if (self.fieldReqModel.myTaxOrgan == 1 && [CJControl getIsTax]) {
        self.viewTax.hidden = NO;
    }else{
        self.viewTax.hidden = YES;
    }
    
//    通信地址
    if (self.fieldReqModel.areaList == 1) {
        self.viewAdressRequired.hidden = NO;
    }else{
        self.viewAdressRequired.hidden = YES;
    }
    
//    详细地址
    if (self.fieldReqModel.address == 1) {
        self.viewAdressDetailRequired.hidden = NO;
    }else{
        self.viewAdressDetailRequired.hidden = YES;
    }

//     简称码
    if (self.fieldReqModel.prefix) {
        self.viewPrefixRequired.hidden = NO;
    }else{
        self.viewPrefixRequired.hidden = YES;
    }
    
}

- (void)laodData{
    
    self.strUpLoadIDFront = @"";
    self.strIDReverse = @"";
    self.strAddressCode = @"";
    self.strIDInhandIm = @"";
    self.strBusinessLicenseImg = @"";
    
    WS(ws);
    [CJNetWork getShipmentInfoSuccess:^(id  _Nullable responseObject) {

//        DLog(@"====== %@",responseObject);
        NSError *error;
        ws.model = [[ShipmentModel alloc]initWithDictionary:responseObject error:&error];
        switch (ws.model.authStatus) {
            case 0:
                ws.labTitle.text = @"您还没有通过实名认证";
//                ws.viewSave.hidden = NO;
                ws.imgVShipperheader.image = UIImageNamed([CJControl getUIWithNew] ? @"zcj_mine_weishenhe":@"");
                break;
            case 1:
                ws.labTitle.text = @"实名认证审核中";
//                ws.viewSave.hidden = NO;
                ws.imgVShipperheader.image = UIImageNamed([CJControl getUIWithNew] ? @"zcj_mine_shenhezhong":@"");
                break;
            case 2:
                ws.labTitle.text = @"已驳回";  //@"实名认证审核未通过";
                ws.labTitle.textColor = CJRGB16Color(0xEF534D);
//                ws.viewSave.hidden = NO;
                ws.imgVShipperheader.image = UIImageNamed([CJControl getUIWithNew] ? @"zcj_mine_weishenhe":@"");
                ws.imgVShipperTop.image = UIImageNamed(@"zcj_shipperTopView_back");
                ws.labTitleContent.text = CJStringWithFormat(@"驳回原因：%@",ws.model.authMsg);

                break;
            case 3:
                ws.labTitle.text = @"您已通过实名认证";
//                ws.viewSave.hidden = YES;
                ws.imgVShipperheader.image = UIImageNamed([CJControl getUIWithNew] ? @"zcj_mine_shehetongguo":@"");
                self.fieldCompanyName.enabled = NO;
                self.fieldLegalName.enabled = NO;
                self.fieldIdNum.enabled = NO;
                self.fieldBusinessLicenseImgNumber.enabled = NO;
                break;
            default:
                break;
        }
        
        ws.fieldName.text = ws.model.userName;
        ws.fieldShipperName.text = [CJControl getLogInPhoneNum];;
        ws.fieldIdNum.text = ws.model.identificationNumber;

        if([ws.model.settlementCode intValue] == 1 || IsStrEmpty(ws.model.settlementCode)){
            ws.yichangFeiLabel.text = @"异常费用不含服务费";
        }else{
            ws.yichangFeiLabel.text = @"异常费用含服务费";
        }
        if([ws.model.receiptNumber intValue] == 1 || IsStrEmpty(ws.model.receiptNumber)){
            ws.upLoadNumberLabel.text = @"1张";
        }else{
            ws.upLoadNumberLabel.text = @"2张";
        }
        if([ws.model.taxPriceDecimal intValue] == 1 || IsStrEmpty(ws.model.taxPriceDecimal)){
            ws.fuwufeiLabel.text = @"5位";
        }else{
            ws.fuwufeiLabel.text = @"2位";
        }
        

        //地区
        ws.fieldAdress.text = CJStringWithFormat(@"%@%@%@",ws.model.provinceName,ws.model.cityName,ws.model.countyName);
        ws.strAddressCode = CJStringWithFormat(@"%@,%@,%@",ws.model.provinceCode,ws.model.cityCode,ws.model.countyCode);
        
        ws.addTitleAddressView.titleIDMarr = [[NSMutableArray alloc] initWithObjects:ws.model.provinceCode,ws.model.cityCode,ws.model.countyCode, nil];
//        ws.strAddressCode = ws.model.countyCode;
        ////    [self.addressBtn setTitle:@"广东省 汕头市 潮阳区 海门镇" forState:UIControlStateNormal];
            
//            self.fieldUploadName.text = self.commonRouteModel.consigneeName;
//            self.fieldUploadPhone.text = self.commonRouteModel.consigneePhone;
//            self.strUpLoadCityCode = self.commonRouteModel.consigneeCountyCode;
//            self.fieldUpLoadAddress.text = self.commonRouteModel.consigneeAddress;
//            self.fieldUpLoadAddressDetail.text = self.commonRouteModel.consigneeDetailAddress;
//            
//            self.fieldDownloadName.text = self.commonRouteModel.consignorName;
//            self.fieldDownloadPhone.text = self.commonRouteModel.consignorPhone;
//            self.fieldDownLoadAddress.text = self.commonRouteModel.consignorAddress;
//            self.strDownLoadCityCode = self.commonRouteModel.consignorCountyCode;
//            self.fieldDownLoadAddressDetail.text = self.commonRouteModel.consignorDetailAddress;
//            self.strCode = self.commonRouteModel.code;
//            self.fieldUpLoadAddressDetail.placeholder = @"";
//            self.fieldDownLoadAddressDetail.placeholder = @"";
        
        ws.fieldTaxAuthority.text = ws.model.myTaxOrgan;
        ws.fieldAdressDetail.text = ws.model.address;
        ws.strUpLoadIDFront = ws.model.identificationImg;
        
        if ([CJRegular getIsStrEmpty:ws.strUpLoadIDFront]) {
            ws.labUpLoadIDFront.text = @"身份证人像面照片未上传";
            ws.labUpLoadIDFrontChange.text = @"(点击上传)";
            ws.labUpLoadIDFront.textColor = CJRGB16Color(0xEF534D);
            ws.labUpLoadIDFrontChange.textColor = CJRGB16Color(0xEF534D);
        }else{
            ws.labUpLoadIDFront.text = @"身份证人像面照片已上传";
            ws.labUpLoadIDFrontChange.text = @"(点击修改)";
            
            if ([CJControl getIdCardDueWarn]) {
                ws.labUpLoadIDFront.textColor = CJRGB16Color(0xEF534D); // CJRGB16Color(0x39b84d);
            }else{
                ws.labUpLoadIDFront.textColor = [UIColor cjMainColor];
            }
            ws.labUpLoadIDFrontChange.textColor =[UIColor cjMainColor]; //  CJRGB16Color(0x39b84d);
        }
        
        ws.strIDReverse = ws.model.identificationBackImg;
        if ([CJRegular getIsStrEmpty:ws.strIDReverse]) {
            ws.labIDReverse.text = @"身份证国徽面照片未上传";
            ws.labIDReverse.textColor = CJRGB16Color(0xEF534D);
            ws.labIDReverseChange.text = @"(点击上传)";
            ws.labIDReverseChange.textColor = CJRGB16Color(0xEF534D);
        }else{
            ws.labIDReverse.text = @"身份证国徽面照片已上传";
//            ws.labIDReverse.textColor = [UIColor cjMainColor]; // CJRGB16Color(0x39b84d);
            if ([CJControl getIdCardDueWarn]) {
                ws.labIDReverse.textColor = CJRGB16Color(0xEF534D); // CJRGB16Color(0x39b84d);
            }else{
                ws.labIDReverse.textColor = [UIColor cjMainColor];
            }
            ws.labIDReverseChange.text = @"(点击修改)";
            ws.labIDReverseChange.textColor = [UIColor cjMainColor]; //  CJRGB16Color(0x39b84d);
        }
        
        ws.strIDInhandIm = ws.model.identificationInhandImg;
        if ([CJRegular getIsStrEmpty:ws.strIDInhandIm]) {
            ws.labIDInhandIm.text = @"手持身份证合照未上传";
            ws.labIDInhandIm.textColor = CJRGB16Color(0xEF534D);
            ws.labIDInhandImChange.text = @"(点击上传)";
            ws.labIDInhandImChange.textColor = CJRGB16Color(0xEF534D);
        }else{
            ws.labIDInhandIm.text = @"手持身份证合照已上传";
//            ws.labIDInhandIm.textColor = [UIColor cjMainColor]; //  CJRGB16Color(0x39b84d);
            
            if ([CJControl getIdCardDueWarn]) {
                ws.labIDInhandIm.textColor = CJRGB16Color(0xEF534D) ; // CJRGB16Color(0x39b84d);
            }else{
                ws.labIDInhandIm.textColor = [UIColor cjMainColor];
            }
            ws.labIDInhandImChange.text = @"(点击修改)";
            ws.labIDInhandImChange.textColor = [UIColor cjMainColor]; // CJRGB16Color(0x39b84d);
        }
        
        if ([CJControl getIsCompany]) {
            ws.fieldCompanyName.text = ws.model.companyName;
            ws.fieldBusinessLicenseImgNumber.text = ws.model.businessLicenseImgNumber;
            ws.strBusinessLicenseImg = ws.model.businessLicenseImg;
            
            if ([CJRegular getIsStrEmpty:ws.strBusinessLicenseImg]) {
                ws.labBusinessLicenseImg.text = @"企业营业执照未上传";
                ws.labBusinessLicenseImg.textColor = CJRGB16Color(0xEF534D);
                ws.labBusinessLicenseImgChange.text = @"(点击上传)";
                ws.labBusinessLicenseImgChange.textColor = CJRGB16Color(0xEF534D);
            }else{
                ws.labBusinessLicenseImg.text = @"企业营业执照已上传";
                ws.labBusinessLicenseImg.textColor = [UIColor cjMainColor];
                ws.labBusinessLicenseImgChange.text = @"(点击修改)";
                ws.labBusinessLicenseImgChange.textColor = [UIColor cjMainColor];
            }
            
            
            ws.fieldLegalName.text = ws.model.legalName;
        }
        
//        @"prefix":[CJControl getThreeUnaryValueStr:self.fieldPrefix]
        ws.fieldPrefix.text = ws.model.prefix;
        ws.fieldIdCardDueDate.text = ws.model.idCardDueDate;
        
        if ([ws.model.idCardDueDate isEqualToString:@"9999-12-31"]) {
            self.strIdCardDueDateLong = @"1";
            self.touchIdCardDueDate.userInteractionEnabled = NO;
            self.imgVIDLong.image = [UIImage imageNamed:@"selected"];
            
        } else {
            self.strIdCardDueDateLong = @"0";
            self.touchIdCardDueDate.userInteractionEnabled = YES;
            self.imgVIDLong.image = [UIImage imageNamed:@"zcj_unSelected"];
        }
        
    }];
}

-(void)setUI{
    
    //山东省 临沂市 兰山区   打印的对应省市县的id=37 =3713 = 371302
    self.addTitleAddressView.title = @"选择地址";
    self.addTitleAddressView.delegate1 = self;
    self.addTitleAddressView.defaultHeight = 350;
    self.addTitleAddressView.titleScrollViewH = 37;
    if (self.addTitleAddressView.titleIDMarr.count > 0) {
        self.addTitleAddressView.isChangeAddress = true;
    }
    else{
        self.addTitleAddressView.isChangeAddress = false;
    }
//    self.addTitleAddressView.isChangeAddress  = YES;
    [self.view addSubview:[self.addTitleAddressView initAddressView]];
}

- (void)setFieldLimit{
    self.fieldBusinessLicenseImgNumber.textFieldType = CJTextFieldStringTypeNumberAndLetter;
    self.fieldBusinessLicenseImgNumber.maxLength = CJTextLengthMax;
}
/// 创建tableview 等
- (void)createTableView{
    
    //    WS(ws);
    NSString *strType = @"ShipperAuthHeaderView";
    if ([CJControl getIsCompany]) {
        strType = @"ShipperAuthBussessView";
        [self setFieldLimit];
    }
    
    CGRect rcFrame = CGRectMake(0, kTopHeight, [[UIScreen mainScreen] bounds].size.width, 0);
    FlexFrameView *header = [[FlexFrameView alloc] initWithFlex:strType Frame:rcFrame Owner:self];
    header.flexibleHeight = YES;
    //        self.labTitle.text = @"您已通过实名认证";
    
    if ([CJControl getUIWithNew]) {
        self.imgVShipperTop.image = UIImageNamed(@"zcj_shipperTopView_new");
//        self.imgVShipperheader.hidden = NO;
    }else{
        self.imgVShipperTop.image = UIImageNamed(@"zcj_shipperTopView");
//        self.imgVShipperheader.hidden = YES;
    }
    
    if ([CJControl getIsCompanyStaff]) {
        self.viewSave.hidden = YES;
        self.fieldName.enabled = NO;
        self.fieldCompanyName.enabled = NO;
        self.fieldLegalName.enabled = NO;
        self.fieldIdNum.enabled = NO;
        self.fieldBusinessLicenseImgNumber.enabled = NO;
        self.fieldTaxAuthority.enabled = NO;
        self.fieldAdressDetail.enabled = NO;
    }else{
        self.viewSave.hidden = NO;
        self.fieldName.enabled = YES;
        self.fieldCompanyName.enabled = YES;
        self.fieldLegalName.enabled = YES;
        self.fieldIdNum.enabled = YES;
        self.fieldBusinessLicenseImgNumber.enabled = YES;
        self.fieldTaxAuthority.enabled = YES;
        self.fieldAdressDetail.enabled = YES;
    }

    
    [header layoutIfNeeded];
    self.tableView.tableHeaderView = header;
    [self.tableView reloadData];
}

- (void)btnSelelctAddressAction{
//    [CJAlert showStringDismissWithDelay:@"隐私政策"];
    if ([CJControl getIsCompanyStaff]) {
        
    }else{
        [self.addTitleAddressView addAnimate];
    }
}
-(void)cancelBtnClick:(NSString *)titleAddress titleID:(NSString *)titleID{
//    [self.addressBtn setTitle:titleAddress forState:UIControlStateNormal];
    
    NSLog( @"%@   %@",titleAddress,  [NSString stringWithFormat:@"%@",titleID]);
    NSLog( @"%@   %@",titleAddress,  [NSString stringWithFormat:@"%@",titleID]);

    if (titleID.length > 6) {
        self.fieldAdress.text = [titleAddress stringByReplacingOccurrencesOfString:@"," withString:@""];
        self.strAddressCode = titleID;
    }
}

- (void)seeBigRenZhengImgWithNetImg:(NSString *)strNetImg localImg:(NSString *)strLocalImg{
    
    if ([[CJControl getThreeUnaryValueStr:strNetImg] isEqualToString:@""]) {
        [[XLImageViewer shareInstanse] showLocalImages:@[@"zcj_zanwu"] index:0 fromImageContainer:self.view];
    }else{
       [[XLImageViewer shareInstanse] showNetImages:@[[CJControl getThreeUnaryValueStr:strNetImg]] index:0 fromImageContainer:self.view];
    }
}

- (void)btnUpLoadIDReverseAction{

    if ([CJControl getIsCompanyStaff]) {
        [self seeBigRenZhengImgWithNetImg:self.strIDReverse localImg:@"yangtu3"];
    }else{
        WS(ws);
        UpLoadImaeVC *vc = [[UpLoadImaeVC alloc]init];
        vc.strTitle = @"上传身份证国徽面照片";
        vc.strImgUrl = self.strIDReverse;
        vc.strSampleImg = @"yangtu3";
        vc.strSampleNetWorkImg = @"identificationBack_img";
        vc.blcokSuccee = ^(id anyObject) {
            ws.labIDReverse.text = @"身份证国徽面照片已上传";
            
            if ([CJControl getIdCardDueWarn]) {
                ws.labIDReverse.textColor = CJRGB16Color(0xEF534D) ; // CJRGB16Color(0x39b84d);
            }else{
                ws.labIDReverse.textColor = [UIColor cjMainColor];
            }
//            ws.labIDReverse.textColor = [UIColor cjMainColor]; //  CJRGB16Color(0x39b84d);
            ws.labIDReverseChange.text = @"(点击修改)";
            ws.labIDReverseChange.textColor = [UIColor cjMainColor]; //  CJRGB16Color(0x39b84d);
            ws.strIDReverse = anyObject;
            
            [ws getAouthInfoWithImgUrl:ws.strIDReverse withType:2];
        };
        [self pushVc:vc];
    }
    
}
- (void)btnUpLoadIDFrontAction{
    
    if ([CJControl getIsCompanyStaff]) {
        [self seeBigRenZhengImgWithNetImg:self.strUpLoadIDFront localImg:@"yangtu4"];
        return;
    }

    WS(ws);
    UpLoadImaeVC *vc = [[UpLoadImaeVC alloc]init];
    vc.strTitle = @"上传身份证人像面照片";
    vc.strImgUrl = self.strUpLoadIDFront;
    vc.strSampleImg = @"yangtu4";
    vc.strSampleNetWorkImg = @"identificationImg";
    vc.blcokSuccee = ^(id anyObject) {
        ws.labUpLoadIDFront.text = @"身份证人像面照片已上传";
//        ws.labUpLoadIDFront.textColor = [UIColor cjMainColor]; //  CJRGB16Color(0x39b84d);
        if ([CJControl getIdCardDueWarn]) {
            ws.labUpLoadIDFront.textColor = CJRGB16Color(0xEF534D) ; // CJRGB16Color(0x39b84d);
        }else{
            ws.labUpLoadIDFront.textColor = [UIColor cjMainColor];
        }
        ws.labUpLoadIDFrontChange.text = @"(点击修改)";
        ws.labUpLoadIDFrontChange.textColor = [UIColor cjMainColor]; //  CJRGB16Color(0x39b84d);
        
        ws.strUpLoadIDFront = anyObject;
        [ws getAouthInfoWithImgUrl:anyObject withType:1];
    };
    [self pushVc:vc];
}

- (void)btnIDInhandImAction{
    
    if ([CJControl getIsCompanyStaff]) {
        [self seeBigRenZhengImgWithNetImg:self.strIDInhandIm localImg:@"yangtu2"];
        return;
    }
    
    WS(ws);
    UpLoadImaeVC *vc = [[UpLoadImaeVC alloc]init];
    vc.strTitle = @"上传手持身份证合照";
    vc.strImgUrl = self.strIDInhandIm;
    vc.strSampleImg = @"yangtu2";
    vc.strSampleNetWorkImg = @"identificationInhandImg";
    vc.blcokSuccee = ^(id anyObject) {
        ws.labIDInhandIm.text = @"手持身份证合照已上传";
//        ws.labIDInhandIm.textColor =  [UIColor cjMainColor]; // CJRGB16Color(0x39b84d);
        if ([CJControl getIdCardDueWarn]) {
            ws.labIDInhandIm.textColor = CJRGB16Color(0xEF534D) ; // CJRGB16Color(0x39b84d);
        }else{
            ws.labIDInhandIm.textColor = [UIColor cjMainColor];
        }
        ws.labIDInhandImChange.text = @"(点击修改)";
        ws.labIDInhandImChange.textColor = [UIColor cjMainColor]; // CJRGB16Color(0x39b84d);
        ws.strIDInhandIm = anyObject;
    };
    [self pushVc:vc];
}

- (void)btnBusinessLicenseImgAction{
    
    if ([CJControl getIsCompanyStaff]) {
        [self seeBigRenZhengImgWithNetImg:self.strBusinessLicenseImg localImg:@"yangtu1"];
        return;
    }
    
    WS(ws);
    UpLoadImaeVC *vc = [[UpLoadImaeVC alloc]init];
    vc.strTitle = @"上传企业营业执照";
    vc.strSampleImg = @"yangtu1";
    vc.strImgUrl = self.strBusinessLicenseImg;
    vc.strSampleNetWorkImg = @"businessLicenseImg";
    vc.blcokSuccee = ^(id anyObject) {
        ws.labBusinessLicenseImg.text = @"企业营业执照已上传";
        ws.labBusinessLicenseImg.textColor = [UIColor cjMainColor]; // CJRGB16Color(0x39b84d);
        ws.labBusinessLicenseImgChange.text = @"(点击修改)";
        ws.labBusinessLicenseImgChange.textColor = [UIColor cjMainColor];
        ws.strBusinessLicenseImg = anyObject;
        [ws getAouthInfoWithImgUrl:anyObject withType:4];
    };
    [self pushVc:vc];
}

/// 选择身份证有效期
- (void)btnSelectIdCardDueDate{
    
    WS(ws);
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]initWithPickerMode:BRDatePickerModeYMD];
    datePickerView.title =  @"选择身份证有效期";
    datePickerView.minDate = [[[NSDate alloc] init] br_getNewDate:[NSDate date] addDays:-31]  ;//[NSDate date]; //[NSDate br_setYear:1980 month:5 day:1];
    datePickerView.maxDate = [NSDate br_setYear:2100 month:5 day:1];
    datePickerView.resultBlock = ^(NSString *selectValue) {

        ws.fieldIdCardDueDate.text = selectValue;
    };
    
    BRPickerStyle *customStyle = [BRPickerStyle pickerStyleWithThemeColor:[UIColor cjMainColor]];
    datePickerView.pickerStyle = customStyle;
    [datePickerView show];
    
}

/// 选择身份证 是否长期
- (void)btnSelectIdCardDueDateLong{
    
    if (self.strIdCardDueDateLong.intValue == 0) {
        self.strIdCardDueDateLong = @"1";
        self.fieldIdCardDueDate.text = @"9999-12-31";
        self.touchIdCardDueDate.userInteractionEnabled = NO;
        self.imgVIDLong.image = [UIImage imageNamed:@"selected"];
        
    } else {
        self.strIdCardDueDateLong = @"0";
        self.fieldIdCardDueDate.text = @"";
        self.touchIdCardDueDate.userInteractionEnabled = YES;
        self.imgVIDLong.image = [UIImage imageNamed:@"zcj_unSelected"];
    }
    
}
- (void)getAouthInfoWithImgUrl:(NSString *)strImgV withType:(int)type{
    
//    1）身份证识别(正面):ocrIdidentityCardFront
//    （2）身份证识别(反面):ocrIdidentityCardFrontBack
//    （3）银行卡识别:ocrBankCard
//    （4）企业营业执照识别:ocrBusinessLicense
//    （5）行驶证识别:ocrVehicleLicense
//    （6）驾驶证识别:ocrDrivingLicense
//    （7）道路运输证识别:ocrRoadTransportCertificate
//    （8）从业资格证识别:ocrQualificationCertificate
    
    NSString * strOcrType = @"";
    switch (type) {
        case 1:
            strOcrType = @"ocrIdidentityCardFront";
            break;
        case 2:
            strOcrType = @"ocrIdidentityCardFrontBack";
            break;
//        case 3:
//            strOcrType = @"ocrBankCard";
//            break;
        case 4:
            strOcrType = @"ocrBusinessLicense";
            break;
        default:
            break;
    }
    
    NSDictionary *dicPra = @{
        @"image":strImgV,
        @"ocrType":strOcrType
    };
    
    NSString *strURL = CJStringWithFormat(@"%@/ntocc-tps-api/ocr/card",CJBaseUrl);
    
    WS(ws);
    [[HDNetworking sharedHDNetworking] GETWithNoMsgOnshow:strURL parameters:dicPra success:^(id  _Nonnull responseObject) {
        
        DLog(@"======%@",responseObject);

//        "data": {
//          "address": "北京市东城区景山前街4号紫禁城乾清宫",
//          "gender": "男",
//          "nation": "满",
//          "issuingDate": "",
//          "cityCode": "1101",
//          "provinceCode": "11",
//          "birth": "",
//          "imageStatus": "unknown",
//          "expiryDate": "",
//          "issuingAuthority": "",
//          "countyCode": "110101",
//          "cityName": "北京市",
//          "identity": "",
//          "name": "爱新觉罗·玄烨",
//          "idcardNumberType": "0",
//          "provinceName": "北京市",
//          "countyName": "东城区"
//        }
        
        NSDictionary *dicData = (NSDictionary *)responseObject;
        NSString *strExpiryDate = @"";
//        NSString  *strInfo = @"";
        
            switch (type) {
                case 1:
//                    strOcrType = @"ocrIdidentityCardFront";
                    if ([[CJControl getThreeUnaryValueStr:dicData[@"identity"]] isEqualToString:@"无"] || [[CJControl getThreeUnaryValueStr:dicData[@"identity"]] isEqualToString:@""]) {
                    }else{
                        ws.fieldIdNum.text = [CJControl getThreeUnaryValueStr:dicData[@"identity"]];
                    }
                    if ([[CJControl getThreeUnaryValueStr:dicData[@"name"]] isEqualToString:@"无"] || [[CJControl getThreeUnaryValueStr:dicData[@"name"]] isEqualToString:@""]) {
                    }else{
                        if ([CJControl getIsCompany]) {
                            ws.fieldLegalName.text = [CJControl getThreeUnaryValueStr:dicData[@"name"]];
                        }else{
                            ws.fieldName.text = [CJControl getThreeUnaryValueStr:dicData[@"name"]];
                        }
                    }
                    
                    if (![CJControl getIsCompany]) {
                        
                        if ([[CJControl getThreeUnaryValueStr:dicData[@"provinceName"]] isEqualToString:@"无"] || [[CJControl getThreeUnaryValueStr:dicData[@"cityName"]] isEqualToString:@"无"] || [[CJControl getThreeUnaryValueStr:dicData[@"countyName"]] isEqualToString:@"无"] || [CJControl getIsEmpty:[CJControl getThreeUnaryValueStr:dicData[@"provinceCode"]]] || [CJControl getIsEmpty:[CJControl getThreeUnaryValueStr:dicData[@"cityCode"]]] ||[CJControl getIsEmpty:[CJControl getThreeUnaryValueStr:dicData[@"countyCode"]]]) {
                        //                        ws.fieldAdress.text = @"";
                            }else{
                                //地区
                                ws.fieldAdress.text = CJStringWithFormat(@"%@%@%@",[CJControl getThreeUnaryValueStr:dicData[@"provinceName"]],[CJControl getThreeUnaryValueStr:dicData[@"cityName"]],[CJControl getThreeUnaryValueStr:dicData[@"countyName"]]);
                                ws.fieldAdressDetail.text = [CJControl getThreeUnaryValueStr:dicData[@"address"]];
                                ws.strAddressCode = CJStringWithFormat(@"%@,%@,%@",[CJControl getThreeUnaryValueStr:dicData[@"provinceCode"]],[CJControl getThreeUnaryValueStr:dicData[@"cityCode"]],[CJControl getThreeUnaryValueStr:dicData[@"countyCode"]]);
                            }
                    }
                    
                    break;
                    
                case 2:
                   
                    strExpiryDate = [CJControl getThreeUnaryValueStr:dicData[@"expiryDate"]];
                    
                    if ([CJRegular getCheckRealDataTimeYMD:strExpiryDate]) {
                        ws.fieldIdCardDueDate.text = strExpiryDate;
                        
                        if ([strExpiryDate isEqualToString:@"9999-12-31"]) {
                            ws.strIdCardDueDateLong = @"1";
                            ws.touchIdCardDueDate.userInteractionEnabled = NO;
                            ws.imgVIDLong.image = [UIImage imageNamed:@"selected"];
                            
                        } else {
                            ws.strIdCardDueDateLong = @"0";
                            ws.touchIdCardDueDate.userInteractionEnabled = YES;
                            ws.imgVIDLong.image = [UIImage imageNamed:@"zcj_unSelected"];
                        }
                    }

                    break;
                case 3:
//                    strOcrType = @"ocrBankCard";
                    break;
                case 4:
//                    strOcrType = @"ocrBusinessLicense";
//                    ws.labBusinessLicenseImg.text = strInfo;
                    
                    if ([[CJControl getThreeUnaryValueStr:dicData[@"creditNum"]] isEqualToString:@"无"] || [[CJControl getThreeUnaryValueStr:dicData[@"creditNum"]] isEqualToString:@""]) {
//                        ws.fieldBusinessLicenseImgNumber.text = @"";
                    }else{
                        ws.fieldBusinessLicenseImgNumber.text = [CJControl getThreeUnaryValueStr:dicData[@"creditNum"]];
                    }
                    if ([[CJControl getThreeUnaryValueStr:dicData[@"companyName"]] isEqualToString:@"无"] || [[CJControl getThreeUnaryValueStr:dicData[@"companyName"]] isEqualToString:@""]) {
//                        ws.fieldCompanyName.text = @"";
                    }else{
                        ws.fieldCompanyName.text =  [CJControl getThreeUnaryValueStr:dicData[@"companyName"]];
                    }
                    break;

                default:
                    break;
            }
        

    } failure:^(NSError * _Nonnull error) {
       DLog(@"++++++++%@",error);

    }];
}

- (void)btnSaveInfoAction{
    
    WS(ws);
    [self showAlertView:@"" strContent:@"请确认提交认证信息？" ClickOnSure:^(NSString *strSure) {
        [ws btnSureSaveInfoAction];
    } ClickOnCancle:^(NSString *strCancle) {
    }];
}

- (void)btnSureSaveInfoAction{
    
    __block NSString *provinceCode = @"";
    __block NSString *cityCode = @"";
    __block NSString *countyCode = @"";
    
    if (self.strAddressCode.length > 6) {
             
        NSArray *arrCodes = [CJControl componentsSeparatedByString:self.strAddressCode withSign:@","];

        [arrCodes enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            if (idx == 0) {
                provinceCode = obj;
            }else if (idx == 1){
                cityCode = obj;
            }else if (idx == 2){
                countyCode = obj;
            }
        }];
    }
    
    
    // 正面
    if (self.fieldReqModel.identificationImg == 1) {
        
        if ([self.strUpLoadIDFront isEqualToString:@""]) {
            [CJAlert showStringDismissWithDelay:@"身份证人像面照片未上传"];
            return ;
        }
    }
    
    // 反面
    if (self.fieldReqModel.identificationBackImg == 1) {
        
        if ([self.strIDReverse isEqualToString:@""]) {
            [CJAlert showStringDismissWithDelay:@"身份证国徽面照片未上传"];
            return ;
        }
    }
    
    // 手持
    if (self.fieldReqModel.identificationInhandImg == 1) {
        
        if ([self.strIDInhandIm isEqualToString:@""]) {
            [CJAlert showStringDismissWithDelay:@"手持身份证合照未上传"];
            return ;
        }
    }
    
    if ([CJControl getIsCompany] && self.fieldReqModel.businessLicenseImg == 1) {
        if ([self.strBusinessLicenseImg isEqualToString:@""]) {
            [CJAlert showStringDismissWithDelay:@"企业营业执照未上传"];
            return ;
        }
    }
    
//    托运人姓名
    if (self.fieldReqModel.userName == 1) {
        
        if ([CJRegular getIsStrEmpty:self.fieldName.text]) {
            [CJAlert showStringDismissWithDelay:self.fieldName.placeholder];
            return;
          }
    }
        
    if (self.fieldReqModel.identificationNumber == 1){
        
        if(![CJRegular getVerifyIdentityCardNum:self.fieldIdNum.text]){
            [CJAlert showStringDismissWithDelay:@"请填写正确的身份证号"];
            return;
        }
    }
    
    if (self.fieldReqModel.idCardDueDate == 1){
        
        if([[CJControl getThreeUnaryValueStr:self.fieldIdCardDueDate.text] isEqualToString:@""]){
            [CJAlert showStringDismissWithDelay:@"请选择身份证有效期"];
            return;
        }
    }
    
    if (self.fieldReqModel.areaList == 1){
//            通信地址
        if ([CJControl getIsEmpty:countyCode]) {
            [CJAlert showStringDismissWithDelay:@"请选择通信地址"];
            return;
        }
    }
        
    if (self.fieldReqModel.address == 1){
        if ([CJControl getIsEmpty:self.fieldAdressDetail.text]){
            [CJAlert showStringDismissWithDelay:self.fieldAdressDetail.placeholder];
            return;
        }
    }
    
    if (self.fieldReqModel.prefix == 1){
        
        if (![CJRegular getPrefixVerification:self.fieldPrefix.text]){
            [CJAlert showStringDismissWithDelay:self.fieldPrefix.placeholder];
            return;
        }
    }
    
    if ([CJControl getIsTax]) {
        
        if([CJControl getIsEmpty:self.fieldTaxAuthority.text] && self.fieldReqModel.myTaxOrgan == 1){
            [CJAlert showStringDismissWithDelay:self.fieldTaxAuthority.placeholder];
            return;
        }
    }

    NSDictionary *dicPar;
    NSString *settlementCode = @"";
    NSString *receiptNumber = @"";
    NSString *decimalNum = @"";
    NSString *electronicFenceStr = @"";
    if([self.yichangFeiLabel.text isEqualToString:@"异常费用不含服务费"]){
        settlementCode = @"1";
    }else{
        settlementCode = @"2";
    }
    if([self.upLoadNumberLabel.text isEqualToString:@"1张"]){
        receiptNumber = @"1";
    }else{
        receiptNumber = @"2";
    }
    if([self.fuwufeiLabel.text isEqualToString:@"2位"]){
        decimalNum = @"2";
    }else{
        decimalNum = @"5";
    }

    if ([CJControl getIsCompany]) {
        
        if (self.fieldReqModel.companyName == 1) {
            if ([CJRegular getIsStrEmpty:self.fieldCompanyName.text]) {
                [CJAlert showStringDismissWithDelay:self.fieldCompanyName.placeholder];
                return;
            }
        }
        
        //    信用代码
        if (self.fieldReqModel.businessLicenseImgNumber == 1) {
            
//            if ([CJRegular getIsStrEmpty:self.fieldBusinessLicenseImgNumber.text]) {
//                [CJAlert showStringDismissWithDelay:@"请填写10或18位的统一社会信用代码"];
//                return;
//            }
            
            if (![CJRegular getXYM:self.fieldBusinessLicenseImgNumber.text length:CJTextLengthMax]) {
                [CJAlert showStringDismissWithDelay:@"请填写正确的统一社会信用代码"];
                return;
            }
        }

        if (self.fieldReqModel.legalName == 1) {
            if ([CJControl getIsEmpty:self.fieldLegalName.text]){
                [CJAlert showStringDismissWithDelay:self.fieldLegalName.placeholder];
                return;
            }
        }
         dicPar  = @{
             @"userName":self.fieldName.text,
             @"identificationNumber":self.fieldIdNum.text,
             @"identificationImg":[CJControl getThreeUnaryValueStr:self.strUpLoadIDFront],
             @"identificationBackImg":[CJControl getThreeUnaryValueStr:self.strIDReverse],
             @"identificationInhandImg":[CJControl getThreeUnaryValueStr:self.strIDInhandIm], // 手持照片
             @"address":[CJControl getThreeUnaryValueStr:self.fieldAdressDetail.text],
             @"provinceCode":provinceCode,
             @"cityCode":cityCode,
             @"countyCode":countyCode,
             @"companyName":[CJControl getThreeUnaryValueStr:self.fieldCompanyName.text],
//                                     @"companyCode":self.model.companyCode,
             @"businessLicenseImg":[CJControl getThreeUnaryValueStr:self.strBusinessLicenseImg],
             @"businessLicenseImgNumber":[CJControl getThreeUnaryValueStr:self.fieldBusinessLicenseImgNumber.text],
             @"myTaxOrgan":[CJControl getThreeUnaryValueStr:self.fieldTaxAuthority.text],
             @"legalName":self.fieldLegalName.text,
             @"prefix":[CJControl getThreeUnaryValueStr:self.fieldPrefix.text],
             @"idCardDueDate":[CJControl getThreeUnaryValueStr:self.fieldIdCardDueDate.text],
             @"branchCode":[CJControl getBranchCode],
             @"settlementCode":settlementCode,
             @"receiptNumber":receiptNumber,
             @"taxPriceDecimal":decimalNum
        };
        
    }else{
        
         dicPar  = @{
             @"userName":[CJControl getThreeUnaryValueStr:self.fieldName.text],
             @"identificationNumber":[CJControl getThreeUnaryValueStr:self.fieldIdNum.text],
             @"identificationImg":[CJControl getThreeUnaryValueStr:self.strUpLoadIDFront],
             @"identificationBackImg":[CJControl getThreeUnaryValueStr:self.strIDReverse],
             @"identificationInhandImg":[CJControl getThreeUnaryValueStr:self.strIDInhandIm], // 手持照片
             @"address":[CJControl getThreeUnaryValueStr:self.fieldAdressDetail.text],
             @"provinceCode":provinceCode,
             @"cityCode":cityCode,
             @"countyCode":countyCode,
             @"myTaxOrgan":[CJControl getThreeUnaryValueStr:self.fieldTaxAuthority.text],
             @"prefix":[CJControl getThreeUnaryValueStr:self.fieldPrefix.text],
             @"idCardDueDate":[CJControl getThreeUnaryValueStr:self.fieldIdCardDueDate.text],
             @"branchCode":[CJControl getBranchCode],
             @"settlementCode":settlementCode,
             @"receiptNumber":receiptNumber,
             @"taxPriceDecimal":decimalNum
        };
    }

    NSString *strURL = CJStringWithFormat(@"%@/ntocc-basic-api/shipment/updateInfo",CJBaseUrl);

    WS(ws);
    [[HDNetworking sharedHDNetworking] dataTaskWithHTTPMethod:PutType url:strURL parameters:dicPar status:OperationTip success:^(id  _Nonnull responseObject) {
        [ws pop];
    } failure:^(NSError * _Nonnull error) {
        
    }];
    
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 0.01;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *MeViewCellId = @"DriverAouthVCcellId";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MeViewCellId];
    if (cell ==nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MeViewCellId];
//        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }

    return cell;
}

- (CJTableView *)tableView{
    if (!_tableView) {
        _tableView = CJTableView.tbInitFrameStyle(CGRectMake(0, kTopHeight + CJTableToTopHeight, SCREEN_WIDTH, SCREEN_HEIGHT-kTopHeight - CJTableToTopHeight),UITableViewStylePlain)
        .tbDelegate(self)
        .tbDataSource(self)
        .tbSetOther(YES)
        .tbEstimatedRowHeight(YES)
        ;

    }
    
    return _tableView;
}
- (void)btnUpLoadNumber1Action{
    UIAlertController *alertC = [UIAlertController alertControllerWithTitle:@"请选择" message:@"异常费用是否包含服务费" preferredStyle:UIAlertControllerStyleActionSheet];
    UIAlertAction *updateAct = [UIAlertAction actionWithTitle:@"异常费用不包含服务费" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        self.yichangFeiLabel.text = @"异常费用不包含服务费";
    }];
    UIAlertAction *twodateAct = [UIAlertAction actionWithTitle:@"异常费用包含服务费" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        self.yichangFeiLabel.text = @"异常费用包含服务费";
    }];
    [alertC addAction:updateAct];
    [alertC addAction:twodateAct];
    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alertC animated:YES completion:^{
        
    }];
}
- (void)btnUpLoadNumber2Action{
    UIAlertController *alertC = [UIAlertController alertControllerWithTitle:@"请选择" message:@"上传回单数量" preferredStyle:UIAlertControllerStyleActionSheet];
    UIAlertAction *updateAct = [UIAlertAction actionWithTitle:@"1张" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        self.upLoadNumberLabel.text = @"1张";
    }];
    UIAlertAction *twodateAct = [UIAlertAction actionWithTitle:@"2张" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        self.upLoadNumberLabel.text = @"2张";
    }];
    [alertC addAction:updateAct];
    [alertC addAction:twodateAct];
    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alertC animated:YES completion:^{
        
    }];
}
- (void)btnUpLoadNumber3Action{
    UIAlertController *alertC = [UIAlertController alertControllerWithTitle:@"请选择" message:@"服务费计算小数" preferredStyle:UIAlertControllerStyleActionSheet];
    UIAlertAction *updateAct = [UIAlertAction actionWithTitle:@"5位" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        self.fuwufeiLabel.text = @"5位";
    }];
    UIAlertAction *twodateAct = [UIAlertAction actionWithTitle:@"2位" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        self.fuwufeiLabel.text = @"2位";
    }];
    [alertC addAction:updateAct];
    [alertC addAction:twodateAct];
    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alertC animated:YES completion:^{
        
    }];
}

@end
